package  
{
	import flash.display.BitmapData;
	import org.flixel.FlxSprite;
	import org.flixel.*;
	/**
	 * ...
	 * @author morgan
	 */
	public class GameState extends FlxState
	{
		[Embed (source = "../data/spotlight.png")] private var img_spotlight:Class;
		
		public static var ref:GameState;
		
		public var hazy:HazyGroup;
		public var above:FlxGroup;
		public var spotlight:FlxSprite;
		
		public var time:Number = 0;
		
		public function GameState() 
		{
			ref = this;
		}
		
		override public function create():void 
		{
			super.create();
			FlxG.mouse.show();
			
			hazy = new HazyGroup();
			above = new FlxGroup();

			spotlight = new FlxSprite(0, 0, img_spotlight);
			spotlight.blend = "overlay";
			spotlight.scale.x = 2;
			spotlight.scale.y = 2;
			
			add(hazy);
			add(above);
			add(spotlight);
			
			FlxG.flash(0xff000000, 0.25);
		}
		
		override public function update():void 
		{
			super.update();
			spotlight.x = FlxG.mouse.x - spotlight.width / 2;
			spotlight.y = FlxG.mouse.y - spotlight.width / 2;
			spotlight.alpha = Math.random() * 0.2 + 0.2;
			
			time += FlxG.elapsed;
		}
		
	}

}